import request from '@/utils/request'

const chapter_baseurl = '/serviceedu/chapter'

export default{
    //1 课程分类列表
    getListByCourseId(courseId){
        return request({
            url: `${chapter_baseurl}/getListByCourseId/${courseId}`,
            method: 'get'
        })
    },
    //新增章节
    save(chapter){
        return request({
            url: `${chapter_baseurl}/save`,
            method: 'post',
            data: chapter
        })
    },
    //根据ID查询章节
    getById(id){
        return request({
            url: `${chapter_baseurl}/getById/${id}`,
            method: 'get'
        })
    },
    //更新
    update(chapter){
        return request({
            url: `${chapter_baseurl}/update`,
            method: 'post',
            data: chapter
        })
    },
    //删除
    delete(id){
        return request({
            url: `${chapter_baseurl}/delete/${id}`,
            method: 'delete'
        })
    }
}